export function checkPhone(phone: string): Promise<any> {
  const checkP = new RegExp(/^[1]([3-9])[0-9]{9}$/)
  const promise = new Promise((resolve, reject) => {
    if (!checkP.test(phone)) {
      uni.showToast({
        title: '请输入正确的手机号！',
        icon: 'none',
      })
      return false
    }
    resolve(true)
  })
  return promise
}

export function isNull(keyword: string, value: string): Promise<any> {
  const promise = new Promise((resolve, reject) => {
    if (value == null || value == '' || value.length < 1) {
      uni.showToast({
        title: keyword + '不能为空！',
        icon: 'none',
      })
      return false
    }
    resolve(true)
  })
  return promise
}
